import request from '@/utils/request'

enum API {
  getTopCategoryUrl = '/category',
  getSubCategoryUrl = '/category/sub/filter',
  getBaseListUrl = '/category/goods/temporary',
}
// 获取一级分类
export const getTopCategoryAPI = (id: any) =>
  request.get<any, any>(API.getTopCategoryUrl, { params: { id } })
// 获取二级分类面包屑导航
export const getCategoryFilterAPI = (id: any) =>
  request.get<any, any>(API.getSubCategoryUrl, { params: { id } })
// 获取二级分类基础列表数据
export const getSubCategoryAPI = (data: any) =>
  request.post<any, any>(API.getBaseListUrl, data)
